package com.gss.armory.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="DOC_METADATA_ATTR_DTLS")
public class DocumentMetaDataAttributesDTO implements Serializable {
	
	public enum MetaAttrDataType {
		String,Integer,Date,Boolean
	};
	
	private int dmaId;
	private String dmaName;
	private MetaAttrDataType dmaDataType;
	private int dmaLength;
	private boolean listType;
	private boolean mandType;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="DMA_ID")
	public int getDmaId() {
		return dmaId;
	}
	@Column(name="DMA_NAME",nullable=false,length=51)
	public String getDmaName() {
		return dmaName;
	}
	@Column(name="DMA_DATA_TYPE",nullable=false)
	@Enumerated(value=EnumType.STRING)
	public MetaAttrDataType getDmaDataType() {
		return dmaDataType;
	}
	@Column(name="DMA_LENGTH")
	public int getDmaLength() {
		return dmaLength;
	}
	public void setDmaId(int dmaId) {
		this.dmaId = dmaId;
	}
	public void setDmaName(String dmaName) {
		this.dmaName = dmaName;
	}
	public void setDmaDataType(MetaAttrDataType dmaDataType) {
		this.dmaDataType = dmaDataType;
	}
	public void setDmaLength(int dmaLength) {
		this.dmaLength = dmaLength;
	}
	@Column(name="DMA_ISLIST",columnDefinition="smallint default 0")
	public boolean isListType() {
		return listType;
	}
	@Column(name="DMA_IS_MANDAT",columnDefinition="smallint default 0")
	public boolean isMandType() {
		return mandType;
	}
	public void setListType(boolean listType) {
		this.listType = listType;
	}
	public void setMandType(boolean mandType) {
		this.mandType = mandType;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("DocumentMetaDataAttributesDTO [dmaId=");
		builder.append(dmaId);
		builder.append(", dmaLength=");
		builder.append(dmaLength);
		builder.append(", dmaName=");
		builder.append(dmaName);
		builder.append("]");
		return builder.toString();
	}

	
	
}
